"use strict";

const Ws = require("ws").Server;
const Utils = require("./utils");

const Logger = require("pomelo-logger").getLogger("Server", process.pid, __filename);

let ws = new Ws({"port": 1234});
ws.on("connection", conn => {
    conn.on("message", message => {
        Logger.debug("server received: [ %j ]", Utils.decode(message));
    });
    // conn.SendPacket(109, {
    //     "time": 23145,
    //     "score": 1234
    // });
    conn.SendPacket(102, {
        "msgType": 12,
        "msgSize": 5,
        "uid": 12234,
        "token": "WebSocket Protobuf Test"
    });
});

